import httpInstance from '@/utils/http'

// 获取banner
export function getBannerAPI(params = {}) {
    // 默认为1 商品为2
    // 设置对象解构默认值为1
    const { distributionSite = '1' } = params
    return httpInstance({
        url: '/home/banner',
        params:{
            distributionSite
        }
    })
}


/**
 * @description: 获取新鲜好物
 * @param {*}
 * @return {*}
 */
export const findNewAPI = () => {
    return httpInstance({
        url: '/home/new'
    })
}

/**
 * @description: 获取人气推荐
 * @param {*}
 * @return {*}
 */
export const getHotAPI = () => {
    return httpInstance({
        url: 'home/hot'
    })
}

/**
 * @description: 获取所有商品模块
 * @param {*}
 * @return {*}
 */
export const getGoodsAPI = () => {
    return httpInstance({
        url: '/home/goods'
    })
}


/**
 *  获取所有商品模块
 *  /home/goods 接口返回格式:
 * {
    "code": "1",
    "msg": "操作成功",
    "result": [
        {
            "id": "1005000", // 一级分类id
            "name": "居家", // 一级分类名
            "picture": "https://yanxuan-item.nosdn.127.net/30959f7fcf980de2be0a6e1937938d45.png?quality=95&thumbnail=610x610&imageView", // 一级分类图片
            "saleInfo": "3折起狂欢", // 销售信息
            "children": [  // 二级分类
                {
                    "id": "1005999003",
                    "name": "居家生活用品",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "1008017",
                    "name": "收纳",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "1017000",
                    "name": "宠物食品",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109243003",
                    "name": "艺术藏品",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109248004",
                    "name": "宠物用品",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109293000",
                    "name": "家庭医疗",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109308000",
                    "name": "中医保健",
                    "layer": 2,
                    "parent": null
                }
            ],
            "goods": [  // 一级分类下的商品信息
                {
                    "id": "4008506", // 商品id
                    "name": "平步青云财神家居摆件", // 商品名
                    "desc": "艺术家瞿广慈作品，手绘上色，礼盒包装", // 商品描述
                    "price": "646.00", // 价格
                    "picture": "https://yanxuan-item.nosdn.127.net/9d5d0083264344b5d85acde13570d025.jpg", // 商品图片
                    "orderNum": 207  // 排序号
                },
                {
                    "id": "4001880",
                    "name": "朱炳仁·铜彩色生肖铜雕摆件",
                    "desc": "十二生肖萌宝系列吉祥物，吉祥又好运",
                    "price": "680.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/04753036f123a8ff1b56db60fe440f47.jpg",
                    "orderNum": 128
                },
                {
                    "id": "4000278",
                    "name": "不易带出，3毫米原味豆腐猫砂2.6千克",
                    "desc": "经典3mm颗粒，强吸水，强包裹",
                    "price": "29.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/9d9590bdb4f7cdd874de6a4554abcff9.jpg",
                    "orderNum": 134
                },
                {
                    "id": "3993828",
                    "name": "七夕礼物·姐姐同款，穿出自信体态矫姿带",
                    "desc": "背薄一寸，年轻十岁，时尚百搭，约会职场小心机",
                    "price": "159.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/a6939f41c48fa9e9c8f7a7ed855351f1.jpg",
                    "orderNum": 235
                },
                {
                    "id": "3997406",
                    "name": "支撑颈椎无负担，颈椎固定器",
                    "desc": "0.23KG轻量化设计，支撑颈椎，低头族救星",
                    "price": "299.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/0cdfd546f8675669b87716114ad5900a.jpg",
                    "orderNum": 138
                },
                {
                    "id": "3997974",
                    "name": "入门首选，语音播报电子血压计",
                    "desc": "全程语音指导，一键测量，监测心率，贴心守护爸妈健康",
                    "price": "109.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/8f0c15f981c5cbcb1aa17215a259fa62.png",
                    "orderNum": 128
                },
                {
                    "id": "3993860",
                    "name": "国大师匠造落款宫廷聚宝缸摆件",
                    "desc": "生财聚宝,藏风聚气,",
                    "price": "508.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/a4e343fcffdb13eaf37428ad851dfb2a.png",
                    "orderNum": 107
                },
                {
                    "id": "4001877",
                    "name": "朱炳仁·铜忠义千秋关公风水摆件",
                    "desc": "众今礼敬关二爷，祈愿慈恩常荫庇",
                    "price": "4280.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/cd9060820a1a52f296fa2502e56a5872.jpg",
                    "orderNum": 171
                }
            ]
        },
        {
            "id": "1005002",
            "name": "美食",
            "picture": "https://yanxuan-item.nosdn.127.net/30959f7fcf980de2be0a6e1937938d45.png?quality=95&thumbnail=610x610&imageView",
            "saleInfo": "3折起狂欢",
            "children": [
                {
                    "id": "1005012",
                    "name": "南北干货",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "1036003",
                    "name": "调味酱菜",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109201001",
                    "name": "方便食品",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109206007",
                    "name": "米面粮油",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109264007",
                    "name": "名酒馆",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109285003",
                    "name": "进口酒",
                    "layer": 2,
                    "parent": null
                }
            ],
            "goods": [
                {
                    "id": "3997547",
                    "name": "泸州老窖特曲浓香型白酒",
                    "desc": "非遗工艺制作，历经24代传承，至今690余年",
                    "price": "280.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/4f67876d44c4c0e318153c02cdfc701f.png",
                    "orderNum": 235
                },
                {
                    "id": "3998106",
                    "name": "德国莫泽尔传统版雷司令干白2019750ml",
                    "desc": "来自摩泽尔传奇名庄",
                    "price": "138.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/bcb8efeee3977d417b961c1eba4584a5.jpg",
                    "orderNum": 222
                },
                {
                    "id": "3494006",
                    "name": "梅乃宿梅酒720毫升",
                    "desc": "小藏手工酿造，百年名酒",
                    "price": "168.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/330913911087b44b0d817dd78233165f.png",
                    "orderNum": 95
                },
                {
                    "id": "3452050",
                    "name": "冻干藤椒牛肉面70克*12盒",
                    "desc": "椒麻爽辣，面弹肉香，地道川味",
                    "price": "79.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/8821731cd2743ae4932f16e71feeecfa.png",
                    "orderNum": 131
                },
                {
                    "id": "3995885",
                    "name": "飞天53%vol500ml贵州茅台酒（带杯）",
                    "desc": "茅台飘香，正品溯源",
                    "price": "1499.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/d46e005025a5d3b73c4781d31b327558.jpg",
                    "orderNum": 320
                },
                {
                    "id": "3463003",
                    "name": "法国年份雅文邑700毫升",
                    "desc": "经典产区限量单一老年份",
                    "price": "1480.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/0a2fff6e0b55178fbbe99d97d94d20a8.png",
                    "orderNum": 120
                },
                {
                    "id": "3494007",
                    "name": "梅乃宿柚子酒720毫升",
                    "desc": "柚香芬芳，清冽百味",
                    "price": "248.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/be0e32bf5eac99dab10e327c1307c275.jpg",
                    "orderNum": 120
                },
                {
                    "id": "3398028",
                    "name": "木桐正牌干红葡萄酒750毫升2016年",
                    "desc": "波尔多五大名庄木桐正牌",
                    "price": "7799.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/05f79c7976b21c0aba772feef5701c80.png",
                    "orderNum": 107
                }
            ]
        },
        {
            "id": "1010000",
            "name": "服饰",
            "picture": "https://yanxuan-item.nosdn.127.net/d0176b163973961ed01818d04ee94a06.png?quality=95&thumbnail=610x610&imageView",
            "saleInfo": "大额优惠\r\n等你来拿",
            "children": [
                {
                    "id": "109303000",
                    "name": "钱包/胸包",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109311005",
                    "name": "女式靴子",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109311006",
                    "name": "女式休闲鞋",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109311007",
                    "name": "女式运动鞋",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109315000",
                    "name": "11.11购物狂欢",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109318003",
                    "name": "【年末狂欢季】",
                    "layer": 2,
                    "parent": null
                }
            ],
            "goods": [
                {
                    "id": "4019044",
                    "name": "自我态度男式多功能多层格局休闲胸包",
                    "desc": "休闲潮流男士斜挎包",
                    "price": "146.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/ac33cf37023facd976dd46dc637c45a8.jpg",
                    "orderNum": 267
                },
                {
                    "id": "4018935",
                    "name": "品质在内格调在外头层真皮防消磁钥匙卡包",
                    "desc": "优质牛皮面料鳄鱼压纹纹理",
                    "price": "80.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/8a60db810c3773fe716f15e1e6c1e071.jpg",
                    "orderNum": 193
                },
                {
                    "id": "4020262",
                    "name": "休闲潮流运动男士胸包",
                    "desc": "轻便休闲运动斜挎胸包",
                    "price": "136.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/fa3d10a78d37bbd3956ef5f8c855d1dc.jpg",
                    "orderNum": 1704
                },
                {
                    "id": "4000464",
                    "name": "趣玩奶酪纯PC拉链拉杆箱（14/20/24/26寸）",
                    "desc": "萌趣外形，实用功能，开启愉快旅程",
                    "price": "199.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/ee5ae3974a18a93f3f4704fe70075e10.png",
                    "orderNum": 286
                },
                {
                    "id": "4013557",
                    "name": "女式复古蜥蜴纹质感牛皮钱包",
                    "desc": "钱包+卡包+零钱包，三合一多功能设计",
                    "price": "104.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/230b28a65c33a719943ae5aa3a75e86a.jpg",
                    "orderNum": 232
                },
                {
                    "id": "4013563",
                    "name": "轻松出行复古经典老花时尚女式钥匙包",
                    "desc": "简约潮流女士钥匙包",
                    "price": "88.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/cedfb4827ca489e574abeb5d19ce21e5.jpg",
                    "orderNum": 254
                },
                {
                    "id": "3995078",
                    "name": "厚底增高休闲运动老爹鞋",
                    "desc": "率性潮流马蹄底，悦享舒适",
                    "price": "286.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/9810d3acbd11e9dd77952eb97032b519.png",
                    "orderNum": 11
                },
                {
                    "id": "4000582",
                    "name": "靓丽色彩，超软一脚蹬运动休闲女鞋",
                    "desc": "运动出游两不误，舒适百搭的一双好鞋",
                    "price": "220.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/4a64a5a54d588eaf5be48647b0ac83bd.png",
                    "orderNum": 123
                }
            ]
        },
        {
            "id": "1011000",
            "name": "母婴",
            "picture": "https://yanxuan-item.nosdn.127.net/01227c93e9098342be591ea57b8953c7.jpg?quality=95&thumbnail=610x610&imageView",
            "saleInfo": "全场3件8折",
            "children": [
                {
                    "id": "1020003",
                    "name": "T恤/polo/衬衫",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "1037006",
                    "name": "儿童鞋",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109243018",
                    "name": "外套/套装",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109243019",
                    "name": "裤子/裙装",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109243021",
                    "name": "连体衣/礼盒",
                    "layer": 2,
                    "parent": null
                },
                {
                    "id": "109243022",
                    "name": "学步鞋",
                    "layer": 2,
                    "parent": null
                }
            ],
            "goods": [
                {
                    "id": "4023751",
                    "name": "释放可爱天性，棉毛布造型领哈衣59-90cm",
                    "desc": "A类婴幼儿标准，安全放心",
                    "price": "62.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/5e2b5629af983dadbceed483dd677eeb.jpg",
                    "orderNum": 288
                },
                {
                    "id": "4005106",
                    "name": "新疆棉，儿童色织条纹短袖连体衣59-90cm",
                    "desc": "100%棉面料，穿着舒适透气",
                    "price": "59.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/2b3748a78c10027dca96504d05acc4bc.png",
                    "orderNum": 253
                },
                {
                    "id": "4023638",
                    "name": "抓绒保暖，毛毛虫儿童运动鞋26-30",
                    "desc": "宝贝上脚活力出街",
                    "price": "109.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/d917c92e663c5ed0bb577c7ded73e4ec.png",
                    "orderNum": 1757
                },
                {
                    "id": "4004565",
                    "name": "会降温的儿童防蚊裤110-160cm",
                    "desc": "跟蚊虫拜拜，清新六色，夏日百搭单品",
                    "price": "25.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/cd5f2f47a6f66af9b219f03afc5c8b33.png",
                    "orderNum": 290
                },
                {
                    "id": "4007902",
                    "name": "纯棉舒适女童印花荷叶袖小衫90-140cm",
                    "desc": "圈圈花图案，拼接大喇叭袖型",
                    "price": "139.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/11d0160b0a30c344d1b250c3e613fbb7.jpg",
                    "orderNum": 293
                },
                {
                    "id": "4027473",
                    "name": "新款LOGO印花时尚学步叫叫鞋",
                    "desc": "软底包头叫叫鞋",
                    "price": "259.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/841d7669e6cc23cb249f47d8d39fc17c.jpg",
                    "orderNum": 1951
                },
                {
                    "id": "4014237",
                    "name": "田园复古木耳边格纹全棉A字衬衫110-160cm",
                    "desc": "甜美木耳边，回归田园",
                    "price": "109.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/3fbddae68393a4b2f7d0339cdcfc5ca6.jpg",
                    "orderNum": 281
                },
                {
                    "id": "4026198",
                    "name": "经典格子元素，男童加绒格子衬衫",
                    "desc": "经典格子元素，翻盖小贴袋装饰",
                    "price": "125.00",
                    "picture": "https://yanxuan-item.nosdn.127.net/084f82c43a71bbc4d280fbb09a47a028.jpg",
                    "orderNum": 2000
                }
            ]
        }
    ]
}
 */

